import pymysql

DBHOST = "localhost"
DBUSER = "root"
DBPASS = "root"
DBNAME = "test"
try:
    conn = pymysql.connect(DBHOST,DBUSER,DBPASS,DBNAME)
    print("数据库成功连接")
except pymysql.Error as e:
    print("数据库连接失败")
